package com.xh.bussiness.tiku.service;

import com.xh.bussiness.system.model.Dictionary;
import com.xh.bussiness.tiku.bean.request.BookVersionRequest;
import com.xh.bussiness.tiku.model.BookVersion;
import com.xh.core.service.IBaseService;
import com.xh.core.bean.XhPage;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 教材版本 服务类
 * </p>
 *
 * @author daiwei
 * @since 2019-01-14
 */
public interface IBookVersionService extends IBaseService<BookVersion> {

    /**
     * 分页查询方法
     * @param page
     * @param bean
     * @return
     */
    public XhPage queryBookVersionPage(XhPage page, BookVersionRequest bean);

    /**
     * 查询方法
     * @param bean
     * @return
     */
    public List queryBookVersion(BookVersionRequest bean);
    /**
     * 
     * @param bean
     * @return
     */
	public Map<String, Object> queryVresion(BookVersionRequest bean);

    boolean moveUpOrDownBookVersion(String bookVersionId, Integer moveType);

    /**
     * 初始化教材版本序号
     */
    public void initBookVersionSortIndex();

	public void truncateTable();

    /**
     * 查询教材、课本、章节树
     * @param bookVersionRequest
     * @return
     */
    List  queryVersionBookTree(BookVersionRequest bookVersionRequest);

    List<BookVersion> queryBookVersionBySubjectCode(String subjectCode);

    /**
     * 后台章节体系 查询教材版本和下面的课本
     * @param subjectCode
     * @return
     */
    List<Dictionary> queryBookVersionBySubject(String subjectCode);

    /**
     * 后台章节体系 模糊查询教材版本和下面的课本
     * @param subjectCode
     * @return
     */
    List<Dictionary> queryLikeDictionaryByCourseSystem(String subjectCode,String name);

    Integer getMaxSortIndex(String subjectCode, String versionId);

    boolean addOrUpdateBookVersion(BookVersion bookVersion);

    void updateSort(List<BookVersion> bookVersions);

}
